<?php

//加载个人中心配置文件
include_once($_SERVER['DOCUMENT_ROOT'] ."/include/user/inc.php");

error_reporting(E_ERROR | E_PARSE);


//所有的参数
$g_cgival 	= array();
//存储中间数据 非输出数据 可以不用
$g_pro	 	= array();
//要显示的数据 输出数据
$g_show 	= array();

function check_cgi_pro()
{		
	global $g_cgival, $g_pro, $g_show, $config;

}


function get_data()
{
	
	$user_info = new user_info();
	$user_login = new user_login();
	$is_login = $user_info->is_logined();
	if($is_login)
	{
		$user_detail_info = $user_info->get_cur_user_info();
		$uid = $user_detail_info["uid"];
		$user_nickname = $user_detail_info["user_nickname"];
		//add login info
		$user_login->insert_user_login($uid,$user_nickname);
	
		echo "success";
	}
	else
	{
		header("Refresh:3 url=login.php");
		echo "false";
	}
}


check_cgi_pro();
get_data();
show_pro();

exit;

function show_pro()
{
	global $g_cgival, $g_pro, $g_show, $config;

	
	$smarty = p_get_smarty();	
	$smarty->assign("g_show", $g_show);
	if (isset($_GET["debug"]))
	{
		print_r($g_show);
	}
	$smarty->display("index.html");
	
	unset($g_cgival);
	unset($g_pro);
	unset($g_show);
	unset($config);
	print_r($_COOKIE);
	
	print_r($_SESSION);
}
?>
